package com.wq.payunion.oauth2.useroauth2.constant;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author: wangqiang20995
 * @Date:2018 年 9 月 9 日 0009
 * @Description:
 * @Resource:
 */
@Component
@ConfigurationProperties(prefix = "authorize.config")
@PropertySource(value = "classpath:authorize.properties",encoding = "UTF-8")
public class AuthorizationConfig {

    private String baiduAuthorizeUrl;

    private String baiduClientId;

    private String callbackUrl;

    private String baiduAccessToken;

    private String baiduClientSecret;

    private Map<String,String> serviceMap;

    private String loggerInUser;

    private String baidu;

    public AuthorizationConfig(){
        this.serviceMap = new ConcurrentHashMap<>();
    }

    public String getBaidu() {
        return baidu;
    }

    public void setBaidu(String baidu) {
        this.baidu = baidu;
        this.serviceMap.put("baidu",baidu);
    }

    public String getServiceMap(String key) {
        return this.serviceMap.get(key);
    }

    public String getLoggerInUser() {
        return loggerInUser;
    }

    public void setLoggerInUser(String loggerInUser) {
        this.loggerInUser = loggerInUser;
    }

    public String getBaiduClientSecret() {
        return baiduClientSecret;
    }

    public void setBaiduClientSecret(String baiduClientSecret) {
        this.baiduClientSecret = baiduClientSecret;
    }

    public String getBaiduAccessToken() {
        return baiduAccessToken;
    }

    public void setBaiduAccessToken(String baiduAccessToken) {
        this.baiduAccessToken = baiduAccessToken;
    }

    public String getBaiduAuthorizeUrl() {
        return baiduAuthorizeUrl;
    }

    public void setBaiduAuthorizeUrl(String baiduAuthorizeUrl) {
        this.baiduAuthorizeUrl = baiduAuthorizeUrl;
    }

    public String getBaiduClientId() {
        return baiduClientId;
    }

    public void setBaiduClientId(String baiduClientId) {
        this.baiduClientId = baiduClientId;
    }

    public String getCallbackUrl() {
        return callbackUrl;
    }

    public void setCallbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
    }
}
